#pragma once
#include <windows.h>
#include <tchar.h>
#include <crtdbg.h>

#define _ASSERT_EXPR(expr, msg) \
            (void)(                                                                                     \
                (!!(expr)) ||                                                                           \
                (1 != _CrtDbgReportW(_CRT_ASSERT, _CRT_WIDE(__FILE__), __LINE__, NULL, L"%ls", msg)) || \
                (_CrtDbgBreak(), 0)                                                                     \
            )

#define _ASSERT(expr) _ASSERT_EXPR((expr), NULL)
#define _ASSERTE(expr) _ASSERT_EXPR((expr), _CRT_WIDE(#expr))

#define ROUND_TO_SIZE(_length, _alignment)  \
        ((((ULONG_PTR)(_length)) + ((_alignment)-1)) & ~(ULONG_PTR) ((_alignment) - 1))
